import request from '@/plugins/axios'

export function fetchList(query) {
  return request({
    url: '/api/clientprovider/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/api/clientprovider',
    method: 'post',
    data: obj
  })
}
export function getBill(query) {
    return request({
        url: '/api/clientprovider/getbill/',
        method: 'get',
        params: query
    })
}

export function getNobill(query) {
    return request({
        url: '/api/clientprovider/getNobill/',
        method: 'get',
        params: query
    })
}
export function getObj(id) {
  return request({
    url: '/api/clientprovider/' + id,
    method: 'get'
  })
}

export function getByclientProviderId(id) {
    return request({
        url: '/api/clientprovider/getByclientProviderId/' + id,
        method: 'get'
    })
}
export function getReContract(query) {
    return request({
        url: '/api/clientprovider/getReContract/',
        method: 'get',
        params: query
    })

}
export function cardCheck(obj) {
    return request({
        url: '/api/clientprovider/getclientproviderbycardid/',
        method: 'get',
        params: obj
    })
}
export function delObj(id) {
  return request({
    url: '/api/clientprovider/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/api/clientprovider',
    method: 'put',
    data: obj
  })
}

export async function toLeadProviderExcle(obj) {
    return request({
        url: '/api/clientprovider/toparseexcel',
        method: 'post',
        data: obj,
        config:{
            headers:{'Content-Type':'multipart/form-data'}
        }
    })
}

export async function getLeadInClientProvider(obj) {
    return request({
        url: '/api/clientprovider/getleadinclientprovider',
        method: 'get',
        params: obj
    })
}

export async function delLeadInClientProvider(obj) {
    return request({
        url: '/api/clientprovider/delleadinclientprovider',
        method: 'get',
        params: obj
    })
}
